-
Notifications
You must be signed in to change notification settings - Fork 0
Udemy/Ts/section5/60: es5 & es6 #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 작성한 커밋입니다.
Github에서 작성한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
✍Udemy/Ts/section5/60 : es5 & es6
🔗Reference
🔥KeyWord
📝Description
dist
우리가 클래스로 실행한 파일의 결과에서는 프로퍼티가 존재하지 않는다. 바로 contruct에는 여전히 매개변수를 name 필드가 정의 되어 있다. 현재 우리는
es6
환경으로 컴파일되게ts.config
에compilerOptions
를target
으로 설정 하였다. 그렇다면 기존과는 다르게es5
로 설정하고 컴파일 하면 어떻게 될까?es5
환경에서는 class가 일반적인 함수로 변경 되었다. 즉, 우리가 설정한 construct가 함수로 변형된 것이다. 그리고 return문에는 해당 함수를 감싼 변수를 반환하고 있다.es5
는바닐라 js
라고 지칭하고es6
는모던 js
라고 지칭한다. 따라서 이 둘의 컴파일된 모습은 es5와 es6의 문법을 준수해서 청사진 class를 생성하는 방법들인 것이다. 이렇게 된 변경된 이유는 직관적이지 않다는 이유였기 때문이다. 그만큼 class가 개발자들 사이에서 당연하게 이해하고 학습되기 때문이라고 볼 수 있다. 따라 ts가 클래스와 유사한 이유와 대중적으로 많이 사용되게 된 이유 또한 위와 같은 이유에서 비롯된게 아닐까 한다. 다시 말해서 constrcut에 집중 했느냐 안했느냐에 따른 차이라고 봐도 좋다고 생각한다.compiler
build
는 소스 코드를 실행 가능한 파일로 만드는 과정을 의미한다. 참고로build
과정에서컴파일
의 과정이 함께 존재한다.📌Summary